package com.alinesno.cloud.base.logger.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * <p>
 * 方法
 * </p>
 *
 * @author WeiXiaoJin
 * @since 2020-01-26 09:30:11
 */
@Entity
@Table(name = "log_method_runtime")
public class LogMethodRuntimeEntity extends BaseWatcherEntity {

	private static final long serialVersionUID = 1L;

	@Column(name = "account_id")
	private String accountId;
	
	@Column(name = "account_name")
	private String accountName;
	
	private String agent;
	
	@Column(name = "create_time")
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	
	private String ip;
	
	@Column(name = "login_name")
	private String loginName;
	
	private String method;
	
	@Column(name = "method_desc")
	private String methodDesc;
	
	@Column(name = "method_time")
	private Long methodTime;
	
	private String operation;
	
	private String params;
	
	@Column(name = "role_power")
	private String rolePower;
	
	private String url;
	
	@Column(name = "record_type")
	private String recordType;
	
	private String methodKey; // 方法唯一值
	private String type; // 类型(接口/实类/数据层)(Type)
	private String level; // 层次(Level)
	private String timePercent; // 每分钟调用次数(TimePercent)
	private int rps; // 每秒请求数(RPS)
	private int count; // 总请求数(Count)
	private double totalrunTime ; // 总的请求时间 
	private double avg; // 平均响应时间(Avg)
	private double min; // 最小响应时间(Min)
	private double max; // 最大响应时间(Max)
	private int fail; // 异常次数(Fail)
	private int ok; // 成功次数(OK)
	
	public String getMethodKey() {
		return methodKey;
	}

	public void setMethodKey(String methodKey) {
		this.methodKey = methodKey;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public String getTimePercent() {
		return timePercent;
	}

	public void setTimePercent(String timePercent) {
		this.timePercent = timePercent;
	}

	public int getRps() {
		return rps;
	}

	public void setRps(int rps) {
		this.rps = rps;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public double getTotalrunTime() {
		return totalrunTime;
	}

	public void setTotalrunTime(double totalrunTime) {
		this.totalrunTime = totalrunTime;
	}

	public double getAvg() {
		return avg;
	}

	public void setAvg(double avg) {
		this.avg = avg;
	}

	public double getMin() {
		return min;
	}

	public void setMin(double min) {
		this.min = min;
	}

	public double getMax() {
		return max;
	}

	public void setMax(double max) {
		this.max = max;
	}

	public int getFail() {
		return fail;
	}

	public void setFail(int fail) {
		this.fail = fail;
	}

	public int getOk() {
		return ok;
	}

	public void setOk(int ok) {
		this.ok = ok;
	}

	public String getAccountId() {
		return accountId;
	}

	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}

	public String getAccountName() {
		return accountName;
	}

	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}

	public String getAgent() {
		return agent;
	}

	public void setAgent(String agent) {
		this.agent = agent;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public String getMethodDesc() {
		return methodDesc;
	}

	public void setMethodDesc(String methodDesc) {
		this.methodDesc = methodDesc;
	}

	public Long getMethodTime() {
		return methodTime;
	}

	public void setMethodTime(Long methodTime) {
		this.methodTime = methodTime;
	}

	public String getOperation() {
		return operation;
	}

	public void setOperation(String operation) {
		this.operation = operation;
	}

	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public String getRolePower() {
		return rolePower;
	}

	public void setRolePower(String rolePower) {
		this.rolePower = rolePower;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getRecordType() {
		return recordType;
	}

	public void setRecordType(String recordType) {
		this.recordType = recordType;
	}

	@Override
	public String toString() {
		return "LogMethodRuntimeEntity{" + "accountId=" + accountId + ", accountName=" + accountName + ", agent="
				+ agent + ", createTime=" + createTime + ", ip=" + ip + ", loginName=" + loginName + ", method="
				+ method + ", methodDesc=" + methodDesc + ", methodTime=" + methodTime + ", operation=" + operation
				+ ", params=" + params + ", rolePower=" + rolePower + ", url=" + url + ", recordType=" + recordType
				+ "}";
	}
}
